<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});


//网站后台路由配置
//Route::get('/admin/login',"Admin\LoginController@login"); //加载后台登录界面
//Route::post('/admin/dologin',"Admin\LoginController@doLogin"); //执行后台登录
Route::get('/admin/logout',"Admin\LoginController@logout"); //执行退出
Route::get('/admin/getcode',"Admin\LoginController@getcode"); //加载验证码


Route::get('/home','Home\IndexController@index');//加载前端页面
Route::resource('/home/list','Home\ListController');//加载前端列表页面


//购物车
Route::get('home/shop',"Home\ShopController@index"); //加载商品信息
Route::get('home/shop/add/{id}',"Home\ShopController@add"); //放入购物车
Route::get('home/shop/show',"Home\ShopController@show"); //浏览购物车
Route::get('home/shop/del/{id}',"Home\ShopController@del"); //删除购物车中的某个商品
Route::get('home/shop/clear',"Home\ShopController@clear"); //清空购物车
Route::get('home/shop/comfirm',"Home\ShopController@comfirm"); //清空购物车




//后台路由组
Route::group(['prefix' => 'admin','middleware' => 'admin'], function () {
    Route::get('/',"Admin\IndexController@index"); //后台首页
	//Route::resource('users', 'Admin\UsersController'); //后台会员管理
	Route::resource('/cate',"Admin\CateController");//后台分类管理
	Route::resource('/display','Admin\DisplayController');//前台首页图片处理
	Route::resource('/order','Admin\OrderController');//订单处理处理
	Route::resource('/orderdetail','Admin\OrderDetailController');//订单明细表处理
	
   	
});
